libxl: provide xenlight.pc
authorWei Liu <wei.liu2@citrix.com>
Fri, 9 Jan 2015 14:32:18 +0000 (14:32 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 19 Jan 2015 15:32:17 +0000 (15:32 +0000)
A pkg-config file for libxl. It also contains two variables
(xenfirmwaredir and libexec_bin) so that tools that are very keen on
knowing the locations of Xen binaries (say, libvirt) can use them to
determine the location of the binaries.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- ran autogen.sh ]

.gitignore
config/Paths.mk.in
configure
m4/paths.m4
tools/configure
tools/configure.ac
tools/libxl/Makefile
tools/libxl/xenlight.pc.in.in [new file with mode: 0644]

index a8f15d571ebd6123850c7490f1501992071903db..33c2ca0293e2ed46ced3b12a1d06b3c386c7d56b 100644 (file)
@@ -153,6 +153,8 @@ tools/include/xen/*
 tools/include/xen-foreign/*.(c|h|size)
 tools/include/xen-foreign/checker
 tools/libxl/libxlu_cfg_y.output
+tools/libxl/xenlight.pc
+tools/libxl/xenlight.pc.in
 tools/libxl/xl
 tools/libxl/testenum
 tools/libxl/testenum.c
index fe10f76b3c5df8f06bf73f25c510a9d75528d55a..150bae7d0b11d9e3af89e2f204051e2f3ed30fd5 100644 (file)
@@ -57,7 +57,7 @@ BASH_COMPLETION_DIR      := $(CONFIG_DIR)/bash_completion.d
 XEN_LOCK_DIR             := @XEN_LOCK_DIR@
 XEN_PAGING_DIR           := @XEN_PAGING_DIR@
 
-XENFIRMWAREDIR           := $(LIBEXEC)/boot
+XENFIRMWAREDIR           := @XENFIRMWAREDIR@
 
 XEN_CONFIG_DIR           := @XEN_CONFIG_DIR@
 XEN_SCRIPT_DIR           := @XEN_SCRIPT_DIR@
index 718e92faa2232025351cc9d37370f249f7688076..8a084c8942764ecedfa780cfb8256afbb82b3048 100755 (executable)
--- a/configure
+++ b/configure
@@ -604,6 +604,7 @@ SHAREDIR
 XEN_LIB_STORED
 XEN_LOG_DIR
 XEN_RUN_DIR
+XENFIRMWAREDIR
 LIBEXEC_BIN
 CONFIG_LEAF_DIR
 host_os
@@ -1930,6 +1931,9 @@ libexecdir=`eval echo $libexecdir`
 LIBEXEC_BIN=`eval echo $libexecdir/$PACKAGE_TARNAME/bin`
 
 
+XENFIRMWAREDIR=`eval echo $libexecdir/$PACKAGE_TARNAME/boot`
+
+
 XEN_RUN_DIR=$localstatedir/run/xen
 
 
index 7ede5bdb3536e315dec657ddbd4fd58c191062f8..db74f5533da650630ab5fa4b57ef115b7a3e1d85 100644 (file)
@@ -77,6 +77,9 @@ dnl This variable will be substituted in various .in files
 LIBEXEC_BIN=`eval echo $libexecdir/$PACKAGE_TARNAME/bin`
 AC_SUBST(LIBEXEC_BIN)
 
+XENFIRMWAREDIR=`eval echo $libexecdir/$PACKAGE_TARNAME/boot`
+AC_SUBST(XENFIRMWAREDIR)
+
 XEN_RUN_DIR=$localstatedir/run/xen
 AC_SUBST(XEN_RUN_DIR)
 
index 4117c837bde4b9fa143818e38c90175b3c27c1a0..1cab8047041564567cb8ff32924b35b980aacb40 100755 (executable)
@@ -718,6 +718,7 @@ SHAREDIR
 XEN_LIB_STORED
 XEN_LOG_DIR
 XEN_RUN_DIR
+XENFIRMWAREDIR
 LIBEXEC_BIN
 CONFIG_LEAF_DIR
 FILE_OFFSET_BITS
@@ -2273,7 +2274,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-ac_config_files="$ac_config_files ../config/Tools.mk hotplug/FreeBSD/rc.d/xencommons hotplug/Linux/init.d/sysconfig.xencommons hotplug/Linux/init.d/xen-watchdog hotplug/Linux/init.d/xencommons hotplug/Linux/init.d/xendomains hotplug/Linux/systemd/proc-xen.mount hotplug/Linux/systemd/var-lib-xenstored.mount hotplug/Linux/systemd/xen-init-dom0.service hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service hotplug/Linux/systemd/xen-watchdog.service hotplug/Linux/systemd/xenconsoled.service hotplug/Linux/systemd/xendomains.service hotplug/Linux/systemd/xenstored.service hotplug/Linux/systemd/xenstored.socket hotplug/Linux/systemd/xenstored_ro.socket hotplug/Linux/vif-setup hotplug/Linux/xen-backend.rules hotplug/Linux/xen-hotplug-common.sh hotplug/Linux/xendomains hotplug/NetBSD/rc.d/xencommons"
+ac_config_files="$ac_config_files ../config/Tools.mk hotplug/FreeBSD/rc.d/xencommons hotplug/Linux/init.d/sysconfig.xencommons hotplug/Linux/init.d/xen-watchdog hotplug/Linux/init.d/xencommons hotplug/Linux/init.d/xendomains hotplug/Linux/systemd/proc-xen.mount hotplug/Linux/systemd/var-lib-xenstored.mount hotplug/Linux/systemd/xen-init-dom0.service hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service hotplug/Linux/systemd/xen-watchdog.service hotplug/Linux/systemd/xenconsoled.service hotplug/Linux/systemd/xendomains.service hotplug/Linux/systemd/xenstored.service hotplug/Linux/systemd/xenstored.socket hotplug/Linux/systemd/xenstored_ro.socket hotplug/Linux/vif-setup hotplug/Linux/xen-backend.rules hotplug/Linux/xen-hotplug-common.sh hotplug/Linux/xendomains hotplug/NetBSD/rc.d/xencommons libxl/xenlight.pc.in"
 
 ac_config_headers="$ac_config_headers config.h"
 
@@ -3767,6 +3768,9 @@ libexecdir=`eval echo $libexecdir`
 LIBEXEC_BIN=`eval echo $libexecdir/$PACKAGE_TARNAME/bin`
 
 
+XENFIRMWAREDIR=`eval echo $libexecdir/$PACKAGE_TARNAME/boot`
+
+
 XEN_RUN_DIR=$localstatedir/run/xen
 
 
@@ -9559,6 +9563,7 @@ do
     "hotplug/Linux/xen-hotplug-common.sh") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/xen-hotplug-common.sh" ;;
     "hotplug/Linux/xendomains") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/xendomains" ;;
     "hotplug/NetBSD/rc.d/xencommons") CONFIG_FILES="$CONFIG_FILES hotplug/NetBSD/rc.d/xencommons" ;;
+    "libxl/xenlight.pc.in") CONFIG_FILES="$CONFIG_FILES libxl/xenlight.pc.in" ;;
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
index 72e2465df71bcdfea3605a745ad3af744730a579..24fdfc3766d50e2a777d0fbbc9c766699a0cc61a 100644 (file)
@@ -27,6 +27,7 @@ hotplug/Linux/xen-backend.rules
 hotplug/Linux/xen-hotplug-common.sh
 hotplug/Linux/xendomains
 hotplug/NetBSD/rc.d/xencommons
+libxl/xenlight.pc.in
 ])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_AUX_DIR([../])
index 6a8575ba2feee57e879905de16e04b2c89a41497..08fe8143574bde8201c0ca508fc2dd983e682350 100644 (file)
@@ -143,13 +143,15 @@ $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenstore)
 SAVE_HELPER_OBJS = libxl_save_helper.o _libxl_save_msgs_helper.o
 $(SAVE_HELPER_OBJS): CFLAGS += $(CFLAGS_libxenctrl)
 
+PKG_CONFIG = xenlight.pc
+
 testidl.o: CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenlight)
 testidl.c: libxl_types.idl gentest.py libxl.h $(AUTOINCS)
        $(PYTHON) gentest.py libxl_types.idl testidl.c.new
        mv testidl.c.new testidl.c
 
 .PHONY: all
-all: $(CLIENTS) $(TEST_PROGS) \
+all: $(CLIENTS) $(TEST_PROGS) $(PKG_CONFIG) \
                libxenlight.so libxenlight.a libxlutil.so libxlutil.a \
        $(AUTOSRCS) $(AUTOINCS)
 
@@ -248,6 +250,10 @@ libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so
 testidl: testidl.o libxlutil.so libxenlight.so
        $(CC) $(LDFLAGS) -o $@ testidl.o libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
+xenlight.pc: xenlight.pc.in Makefile
+       @sed -e 's/@@version@@/$(MAJOR).$(MINOR)/g' < xenlight.pc.in > $@.new
+       @mv -f $@.new $@
+
 .PHONY: install
 install: all
        $(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
@@ -255,6 +261,7 @@ install: all
        $(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
        $(INSTALL_DIR) $(DESTDIR)$(BASH_COMPLETION_DIR)
        $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+       $(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)/pkgconfig
        $(INSTALL_PROG) xl $(DESTDIR)$(SBINDIR)
        $(INSTALL_PROG) xen-init-dom0 $(DESTDIR)$(LIBEXEC_BIN)
        $(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(LIBEXEC_BIN)
@@ -268,12 +275,14 @@ install: all
        $(INSTALL_DATA) libxlutil.a $(DESTDIR)$(LIBDIR)
        $(INSTALL_DATA) libxl.h libxl_event.h libxl_json.h _libxl_types.h _libxl_types_json.h _libxl_list.h libxl_utils.h libxl_uuid.h libxlutil.h $(DESTDIR)$(INCLUDEDIR)
        $(INSTALL_DATA) bash-completion $(DESTDIR)$(BASH_COMPLETION_DIR)/xl.sh
+       $(INSTALL_DATA) xenlight.pc $(DESTDIR)$(SHAREDIR)/pkgconfig/
 
 .PHONY: clean
 clean:
        $(RM) -f _*.h *.o *.so* *.a $(CLIENTS) $(DEPS)
        $(RM) -f _*.c *.pyc _paths.*.tmp _*.api-for-check
        $(RM) -f testidl.c.new testidl.c *.api-ok
+       $(RM) -f xenlight.pc xenlight.pc.in
 
 distclean: clean
 
diff --git a/tools/libxl/xenlight.pc.in.in b/tools/libxl/xenlight.pc.in.in
new file mode 100644 (file)
index 0000000..c27872e
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@prefix@
+includedir=@includedir@
+libdir=@libdir@
+xenfirmwaredir=@XENFIRMWAREDIR@
+libexec_bin=@LIBEXEC_BIN@
+
+Name: Xenlight
+Description: The Xenlight library for Xen hypervisor
+Version: @@version@@
+Cflags: -I${includedir}
+Libs: -L${libdir} -lxenlight